<?php

/*
|--------------------------------------------------------------------------
| Web Routes
|--------------------------------------------------------------------------
|
| Here is where you can register web routes for your application. These
| routes are loaded by the RouteServiceProvider within a group which
| contains the "web" middleware group. Now create something great!
|
*/

// Route::get('/', function () {

//     return view('welcome',['website'=>'laravel hello world']);
// });

Route::get('/', 'StudentController@index');


//Route::get('member/info','MemberController@info');

//Route::get('member/info',['uses'=>'MemberController@info']);

// Route::get('member/info',[
//     'uses'=>'MemberController@info',
//     'as'=>'memberinfo'  //别名
// ]);

//路由传参
//Route::get('member/info/{id?}','MemberController@info')->where(['id'=>'[0-9]+']);

Route::get('member/info','MemberController@info');

Route::get('text','StudentController@text');

Route::get('query1','StudentController@query1');
Route::get('orm1','StudentController@orm1');
Route::get('section1','StudentController@section1');
Route::get('request1','StudentController@request1');


Route::get('activity0','StudentController@activity0');

Route::group(['middleware'=>['activity'] ],function (){
    Route::get('activity1','StudentController@activity1');
    Route::get('activity2','StudentController@activity2');
});




Route::get('urlTest',[
     'uses'=>'StudentController@urlTest',
     'as'=>'urlas'  //别名
 ]);








Route::get('hello', function (){
    return 'hello welcome to laravel world';
});

Route::get('user/{id}/profile', function ($id) {
     $url = route('aaaa', ['id' => $id]);
  
    return $url;
})->name('aaaa');

Route::get('bbb', function () {
    // $url = route('aaaa', ['id' => $id]);
    $url = route('aaaa');

    return $url;
})->name('aaaa');





Route::group(['middleware'=>['web']],function(){

    Route::get('student/index',['uses'=>'StudentController@index']);
    Route::any('student/create',['uses'=>'StudentController@create']);
    Route::any('student/save',['uses'=>'StudentController@save']);
    Route::any('student/update/{id?}',['uses'=>'StudentController@update']);
    Route::any('student/detail/{id?}',['uses'=>'StudentController@detail']);
    Route::any('student/delete/{id?}',['uses'=>'StudentController@delete']);

});